import { DICT_ENUM } from '@/enum/system';
import { getDictList } from '@/utils/common/dict';
import type { LabeledValue } from 'ant-design-vue/es/select';

const themeTypeOptions = ref<LabeledValue[]>([]);
const materialCategoryOptions = ref<LabeledValue[]>([]);
const materialFileTypeOptions = ref<LabeledValue[]>([]);

/* 主题类型 */
export const getThemeDictType = async () => {
  if (themeTypeOptions.value.length > 0) {
    return themeTypeOptions.value;
  }
  themeTypeOptions.value = await getDictList(DICT_ENUM.THEME_CATEGORY);

  return themeTypeOptions.value;
};

export const getMaterialCategoryOptions = async () => {
  materialCategoryOptions.value = await getDictList(DICT_ENUM.MATERIAL_CATEGORY);
};
export const getMaterialFileTypeOptions = async () => {
  materialFileTypeOptions.value = await getDictList(DICT_ENUM.MATERIAL_TYPE);
};

export { themeTypeOptions, materialCategoryOptions, materialFileTypeOptions };
